<? include_once("config.php")?>
<!doctype html>
<html lang="zh-CN">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
	    <meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no,width=device-width,height=device-height">
        <? require_once('title.php');?>
        <link href="favicon.ico" rel="shortcut icon">
        <link rel="stylesheet" href="css/common/swiper.css">
        <link rel="stylesheet" href="css/common/base.css">
        <link rel="stylesheet" href="css/common/media.css">
        <link rel="stylesheet" href="css/common/animation.css">
        <link rel="stylesheet" href="css/example/style.css">
        <script src="js/common/loading.js"></script>
    </head>
    <body>
        <div id="loadingDiv"></div>
        <div class="beginning left flex flex-align-items">
                <img src="img/common/bodyBg.jpg" class="bg obj-c" alt="">
                <i class="line top"></i>
                <i class="line bottom"></i>
                <img src="img/common/beginningLogo.png" alt="入场logo图">
        </div>
        <div class="beginning right flex flex-align-items">
                <img src="img/common/bodyBg.jpg" class="bg obj-c" alt="">
                <i class="line top"></i>
                <i class="line bottom"></i>
                <img src="img/common/beginningLogoTxt.png" alt="入场logo文字">
        </div>
        <div class="cutLetter flex flex-align-items flex-justify-content">
            <img src="img/common/bodyBg.jpg" class="bg obj-c" alt="">
            <p>创意</p>
            <p class="mid">规范</p>
            <p>智能</p>
        </div>
		            <?
$typename="";
if (isset($_REQUEST['tid']) && $_REQUEST['tid']>0)
{
	$tid = $_REQUEST['tid'];
	$protypeDetailRs = $maindb->Execute("SELECT * FROM t_protype WHERE IsShow=1 AND id=?",array($tid));
	if ($protypeDetailRs->RecordCount() >0)
	{
		$protypeObj = $protypeDetailRs->FetchObject();
        $typename=$protypeObj->CALLED;
		
	}
}

if (isset($_REQUEST['pid']) && $_REQUEST['pid']>0)
{
	$pid = $_REQUEST['pid'];
	$proDetailRs = $maindb->Execute("SELECT * FROM t_products WHERE IsShow=1 AND id=?",array($pid));
	if ($proDetailRs->RecordCount() >0)
	{
		$proObj = $proDetailRs->FetchObject();
		$typeid=$proObj->TYPEID;
		$ProName=$proObj->PRONAME;
	}
	
	$pro=$maindb->Execute("SELECT * FROM t_protype WHERE id=?",array($typeid));
	if($pro->RecordCount()>0){
		$proObj=$pro->FetchObject();
		$ParentPath =$proObj->PARENTPATH;
		$arr=explode("-",$ParentPath);
		$num=count($arr);
		$pid=$arr[$num-1];
	}
	$pro=$maindb->Execute("SELECT * FROM t_protype WHERE id=?",array($pid));
	if($pro->RecordCount()>0){
		$proObj=$pro->FetchObject();
		$pname=$proObj->CALLED;
		$pid=$proObj->ID;
	}
}
		
?>

        <div class="container horizontal">
            <? require_once('header.php');?>
            <main>
			
			<?
			if (isset($_REQUEST['pid']) && $_REQUEST['pid']>0)
			{
				$pid = $_REQUEST['pid'];
				$proDetailRs = $maindb->Execute("SELECT * FROM t_products WHERE IsShow=1 AND id=?",array($pid));
				if ($proDetailRs->RecordCount() >0)
				{
			$maindb->Execute("UPDATE t_products SET Hits=Hits+1 WHERE id=?",array($pid));
					$proObj = $proDetailRs->FetchObject();
					?>
					
					
                <div class="flip flex">
                    <div class="swiper">
                        <div class="contn">
                            <div class="swiper-container headSwiper">
                                <div class="swiper-wrapper">
									<? 
									$proimgList=$maindb->Execute("select * from t_img where  ProID='".$_REQUEST['pid']."'");
									
									$i=0;
									while(!$proimgList->EOF)
									{
									$proimgObj = $proimgList->FetchObject();	
									?>
										<div class="swiper-slide"><img src="upload/<?=$proimgObj->PICURL?>" alt=""></div>
									<?	
										
										$proimgList->MoveNext();
										$i++;
									}
									?> 
                                </div>
                            </div>
                            <div class="swiper-button-prev header-prev"></div>
                            <div class="swiper-button-next header-next"></div>
                        </div>
                    </div>
                    <div class="objects">
                        <div class="fluid flex">
                            <p class="empNum"><?=$proObj->PRONAME?></p>
                            <div class="details">
                                <div class="info flex">
                                    <span>项目类型：<?=$pname?></span>
                                    <span>建筑面积：<?=$proObj->MJ?></span>
                                    <span>项目地点：<?=$proObj->DD?></span>
                                </div>
                                <div class="txt flex">
                                    <span>项目概况：</span>
                                    <div><?=$proObj->CONTENT?></div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
				<?
				}
				else
				{
					@header("HTTP/1.1 404 Not Found");
					@header("Status: 404 Not Found");
					exit();
				}
			}
			else
			{
				@header("HTTP/1.1 404 Not Found");
				@header("Status: 404 Not Found");
				exit();
			}
			?>

			
            </main>
            <? require_once('footer.php');?>
        </div>
        
        <script src="js/common/swiper.js"></script>
        <script src="js/common/jquery.js"></script>
        <script src="js/common/common.js"></script>
        <script src="js/common/animation.js"></script>
        <script src="js/example/index.js"></script>
    </body>
</html>